package com.zking.ssm.util;

import java.util.HashMap;
import java.util.Map;

public class ReturnData extends HashMap<String,Object> {
    public static final int SUCCESS=1;
    public static final int FAIL=-1;

    public ReturnData(){
        super();
    }
    public ReturnData(int code,String msg,Object data){
        super();
        this.setCode(code);
        this.setMsg(msg);
        this.setData(data);
    }

    public ReturnData (int code,String msg){
        super();
        this.setCode(code);
        this.setMsg(msg);
    }

    public void setCode(int code){
        this.put("code",code);
    }
    public void setMsg(String msg){
        this.put("msg",msg);
    }

    public void setData(Object data){
        this.put("data",data);
    }

    public void setErrors(Map<String,String> errors){
            this.put("errors",errors);
    }
}
